package com.example.beautyimage;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

public class ModelImage extends AppCompatActivity {
    private ImageView imageView;
    private Button btnHJ;
    private Button btnDP;
    private Button btnFD;
    private Button btnNight;
    private Button btnGX;
    private Button btnRecover;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_model_image);
        final Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.drawable.cl);
        imageView = findViewById(R.id.iv_cl);
        btnHJ = findViewById(R.id.btn_hj);
        btnDP = findViewById(R.id.btn_dp);
        btnFD = findViewById(R.id.btn_fd);
        btnNight = findViewById(R.id.btn_night);
        btnGX = findViewById(R.id.btn_gx);
        btnRecover = findViewById(R.id.btn_recover);
        imageView.setImageBitmap(bitmap);
        btnDP.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                imageView.setImageBitmap(ImageHelper.handleImageNegative(bitmap));
            }
        });
        btnHJ.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                imageView.setImageBitmap(ImageHelper.handleImageReminiscence(bitmap));
            }
        });
        btnFD.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                imageView.setImageBitmap(ImageHelper.handleImageRelief(bitmap));
            }
        });
        btnNight.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                imageView.setImageBitmap(ImageHelper.handleImageNight(bitmap));
            }
        });
        btnGX.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                imageView.setImageBitmap(ImageHelper.handleImageSensibility(bitmap));
            }
        });
        btnRecover.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                imageView.setImageBitmap(bitmap);
            }
        });
    }
}
